import { getCookie } from '_commonFn/cookie.js'
import { getBrowserName } from '../common/browser';

// 返回请求日志参数
export const getLog = ({
    referrer = '',
    location = '',
    addRess = '',
    resolution = `${window.screen.width} * ${window.screen.height}`,
}) => {
    const appVersion = navigator.appVersion,
    isIPhone = appVersion.indexOf("iPhone") > 0,
    appVersionList = appVersion.split(" ");
    return {
        UserId: getCookie('UserId'),
        IP: '',
        IpAddRess: addRess,
        Platform: isIPhone ? '' : appVersionList[5],
        Browser: getBrowserName(),
        Rotes: '',
        SourceUrl: location,
        AssessCookie: '',
        AssessTime: new Date().getTime(),
        Referrer: referrer,
        Resolution: resolution,
    }
}